<template>
    <div>
        <h1>登录用户：{{user.name}}</h1>
        <h3>爱好：{{user.hoby}}</h3>
    </div>
</template>
<script>
import axios from "axios";

export default {
  data: function() {
    return {
      user: {}
    };
  },
  methods: {},
  mounted: function() {
    //页面一加载就会执行的一个方法
    var that = this;
    axios
      .get("/api//user/getLoginUser")
      .then(function(response){
          if(response.data.code==200){
              that.user=response.data.data;
          }else{
              alert(response.data.msg)
          }
      })
      
  }
};
</script>
